//
//  ZXPartGoodsView.m
//  ZiJinLian
//
//  Created by 震霄 张 on 2018/3/10.
//  Copyright © 2018年 lzy. All rights reserved.
//

#import "ZXPartGoodsView.h"

@interface ZXPartGoodsView()
@property (weak, nonatomic) IBOutlet UIImageView *iconView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;

@end

@implementation ZXPartGoodsView

+(instancetype)zxpartGoodsView
{
	return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil].lastObject;
}
-(void)awakeFromNib
{
	[super awakeFromNib];
	self.autoresizingMask = UIViewAutoresizingNone;
}
-(void)setModel:(HomeCulGoodModel *)model
{
	_model = model;
	[self.iconView sd_setImageWithURL:[NSURL URLWithString:model.imageUrl] placeholderImage:[UIImage imageNamed:@""]];
	self.nameLabel.text = model.title;
	self.priceLabel.text = [NSString stringWithFormat:@"¥%@",model.fixedPrice];
}
- (IBAction)btnClick:(id)sender {
	NSMutableDictionary *dic = [NSMutableDictionary dictionary];
	[dic setValue:@"2" forKey:@"type"];
	[dic setValue:[NSString stringWithFormat:@"%ld",self.model.skuId] forKey:@"value"];
	[[NSNotificationCenter defaultCenter]postNotificationName:@"jumpOther" object:nil userInfo:dic];
}

@end
